﻿using FriendStar.Code;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using FriendStar.Application.VBaseData;
using FriendStar.Domain.Entity.VBaseData;
using System;

namespace FriendStar.Web.Areas.VBaseData.Controllers
{
    public class V_ZSJ_12_GH_SuProduction_DatStorController : ControllerBase
    {
        //
        // GET: /VBaseData/V_ZSJ_12_GH_SuProduction_DatStor/
        private V_ZSJ_12_GH_SuProduction_DatStorApp zsj_12_GH_SuProduction_DatStorApp = new V_ZSJ_12_GH_SuProduction_DatStorApp();
       
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetGridJson(string companyNameOrNo,string docuTypeNO, string productionNO, string productionName, string currentDate)
        {
            if(string.IsNullOrEmpty(currentDate))
            {
                currentDate = DateTime.Now.ToString("yyyy-MM-dd");
            }
            var data = zsj_12_GH_SuProduction_DatStorApp.GetList(currentDate, companyNameOrNo, "25000", docuTypeNO, productionNO, productionName);
            return Content(data.ToJson());
        }

        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetListForPick(string currentDate, string companyNo,string productionNO, string productionName)
        {
            if(string.IsNullOrEmpty(currentDate))
            {
                currentDate = DateTime.Now.ToString("yyyy-MM-dd");
            }
            var data = zsj_12_GH_SuProduction_DatStorApp.GetListForPick(currentDate, companyNo+"", productionNO+"",productionName+"");
            return Content(data.ToJson());
        }
    }
}
